﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminIndexMaster.master" AutoEventWireup="true" CodeFile="Admin_CityArea.aspx.cs" Inherits="Admin_Admin_CityArea" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="nick">
        <tr>
            <td class="tit">
                地区：<asp:DropDownList ID="DropDownList_Province" runat="server" AutoPostBack="True"
                    DataTextField="Province" DataValueField="Province" OnSelectedIndexChanged="DropDownList_Province_SelectedIndexChanged">
                </asp:DropDownList>
                城市：
                <asp:DropDownList ID="DropDownList_City" runat="server" DataTextField="City" DataValueField="City"
                    AutoPostBack="True" OnSelectedIndexChanged="DropDownList_City_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:Button ID="Button_All" runat="server" Text=" 全 部 " OnClick="Button_All_Click" />
                <asp:Button ID="Button_Add" runat="server" Text=" 添 加 " OnClick="Button_Add_Click" />
                <a id="top_top" href="#down_down" align="right">最底部↓</a>
            </td>
            <td class="tit">
                <asp:LinkButton ID="LinkButton0" CommandName="0" runat="server" OnCommand="LinkButton_Command">关闭中</asp:LinkButton>
                |
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="1" OnCommand="LinkButton_Command">启用中</asp:LinkButton>
            </td>
        </tr>
    </table>
    <div id="product_history">
        <asp:GridView ID="GridView_CityArea" runat="server" AutoGenerateColumns="False" CssClass="adminlist">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <input name='id' type='checkbox' onclick='unselectall()' id='id' value='<%# Eval("ID") %>'>
                    </ItemTemplate>
                    <HeaderTemplate>
                        <input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>
                    </HeaderTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="编号">
                    <ItemTemplate>
                        <asp:Label ID="Label_Name" runat="server" Text='<%#Eval("ID")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="地区">
                    <ItemTemplate>
                        <asp:Label ID="Label_Type" runat="server" Text='<%#Eval("Province")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="城市">
                    <ItemTemplate>
                        <asp:Label ID="Label_Methods" runat="server" Text='<%#Eval("City")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="县/区">
                    <ItemTemplate>
                        <asp:Label ID="lblArea" runat="server" Text='<%#Eval("Area")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="启用状态">
                    <ItemTemplate>
                        <asp:Label ID="Label_Value" runat="server" Text='<%# Convert.ToBoolean(Eval("Flag"))?"启用中":"已关闭"%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="LinkButton_Edit" CommandName='<%#Eval("ID")%>'
                            OnCommand="LinkButton_Edit_Command">编辑</asp:LinkButton>
                        ｜
                        <asp:LinkButton runat="server" ID="LinkButton_Delete" OnClientClick="return confirm('确定要删除么?')"
                            CommandName='<%#Eval("ID")%>' OnCommand="LinkButton_Delete_Command">删除</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <tr>
                    <td colspan="8">
                        找不到相关数据！
                    </td>
                </tr>
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
    <%--                 <div align="center">
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                        CurrentPageButtonPosition="Center" CustomInfoHTML="第 %CurrentPageIndex% 页，共%PageCount%页，每页%PageSize%条"
                        FirstPageText="首页" LastPageText="尾页" LayoutType="Table" NextPageText="下一页" PageIndexBoxType="DropDownList"
                        PagingButtonLayoutType="Span" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        SubmitButtonText="Go" TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到">
                    </webdiyer:AspNetPager>
             </div>--%>
    <div class="div_btm">
        <asp:Button ID="Button_Check_Open" runat="server" Text="批量启用" Enabled="false" OnClick="Button_Check_Open_Click" />
        &nbsp;
        <asp:Button ID="Button_Check_Close" runat="server" Text="批量关闭" Enabled="false" OnClick="Button_Check_Close_Click" />
        &nbsp;
        <asp:Button ID="Button_Delete" runat="server" Text="批量删除" OnClick="Button_Delete_Click" />
        <a id="down_down" href="#top_top">最顶部↑</a>
    </div>
    <script type="text/javascript">
        function unselectall() {
            if (document.myform.chkAll.checked) {
                document.myform.chkAll.checked = document.myform.chkAll.checked & 0;

            }
        }
        function CheckAll(form) {
            for (var i = 0; i < form.elements.length; i++) {
                var e = form.elements[i];

                if (e.Name != 'chkAll' && e.disabled == false)
                    e.checked = form.chkAll.checked;
            }
        }
    </script>
</asp:Content>
